package com.scott.observer.core;

/**
 * 具体的被观察的对象
 */
public class ConcreteSubject extends Subject {

    private String state;

    @Override
    public void changeState(String newState) {
        state = newState;
        System.out.printf("被观察的目标状态更新为:%s\n",newState);
        notifyObservers(newState);
    }

    @Override
    public String getState() {
        return this.state;
    }

}
